﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MainSite.Master" AutoEventWireup="true" CodeBehind="testingemployeeselectionbinding.aspx.cs" Inherits="BSCMFF.Web.Pages.working.testingemployeeselectionbinding" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">

<asp:PlaceHolder ID="PlaceHolderEmployees" runat="server" >

</asp:PlaceHolder>


<asp:Button ID="b" runat="server" Text="postback" onclick="b_Click" />
<asp:Button ID="Button1" runat="server" Text="realpostback"  />

<telerik:RadGrid ID="RadGrid1" runat="server" 
        onitemdatabound="RadGrid1_ItemDataBound" >
<MasterTableView AutoGenerateColumns="False" DataKeyNames="ID" ViewStateMode="Disabled"
        >
<CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>

<RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>

<ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>

    <Columns>
        <telerik:GridBoundColumn DataField="Fullname" 
            FilterControlAltText="Filter Fullname column" HeaderText="Fullname" 
            ReadOnly="True" SortExpression="Fullname" UniqueName="Fullname">
        </telerik:GridBoundColumn>
        
        
        <telerik:GridBoundColumn DataField="Manager_FK" DataType="System.Int32" 
            FilterControlAltText="Filter Manager_FK column" HeaderText="Manager_FK" 
            SortExpression="Manager_FK" UniqueName="Manager_FK">
        </telerik:GridBoundColumn>
        <telerik:GridTemplateColumn>
            <HeaderTemplate>
                <asp:Label ID="HeaderEvaluator" runat="server" Text="Evaluator" ></asp:Label>
            </HeaderTemplate>
            <ItemTemplate>
                <bsc:EmployeeSimpleSelection runat="server"  SelectedUserID='<%# Eval("Manager_FK") %>' /> 
            </ItemTemplate>
        </telerik:GridTemplateColumn>
        <%--<telerik:GridTemplateColumn>
            <HeaderTemplate>
                <asp:Label ID="HeaderEvaluator" runat="server" Text="Evaluator2" ></asp:Label>
            </HeaderTemplate>
            <ItemTemplate>
                <bsc:EmployeeSimpleSelection  runat="server"  SelectedUserID='<%# DataBinder.Eval(Container.DataItem, "Manager_FK") %>'
                 /> 
            </ItemTemplate>
            
        </telerik:GridTemplateColumn>--%>
        <%--<telerik:GridTemplateColumn>
            <HeaderTemplate>
                <asp:Label ID="HeaderEvaluator" runat="server" Text="Evaluator" ></asp:Label>
            </HeaderTemplate>
            <ItemTemplate>
                <asp:Label ID="LabelManager" runat="server" Text=' <%# Eval("User2.ID") %>' /> 
                <bsc:EmployeeSimpleSelection  runat="server"  SelectedUserID='<%# Eval("User2.ID") %>' />
            </ItemTemplate>
            <EditItemTemplate>
                <bsc:EmployeeSimpleSelection  runat="server"  SelectedUserID='<%# Eval("Manager_FK") %>' /> 
            </EditItemTemplate>
        </telerik:GridTemplateColumn>--%>
    </Columns>

<EditFormSettings>
<EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
</EditFormSettings>
</MasterTableView>

<FilterMenu EnableImageSprites="False"></FilterMenu>

<HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default"></HeaderContextMenu>
</telerik:RadGrid>

<asp:PlaceHolder ID="PlaceHolderGrid" runat="server" >
tralala
</asp:PlaceHolder>


<asp:EntityDataSource ID="EntityDataSource1" runat="server" 
    ConnectionString="name=BSCEntities" DefaultContainerName="BSCEntities" 
    EnableFlattening="False" EntitySetName="Users" EntityTypeFilter="" Select="" 
        Where="it.ID == @id">
    <WhereParameters>
        <asp:Parameter DbType="Int32" DefaultValue="26" Name="id" />
    </WhereParameters>
</asp:EntityDataSource>

</asp:Content>
